
//
// 120609 - AH - (Studentsenter) Created.
//

package org.soekrat;

/**
 * <p>
 *   Error which is reported from a Soekrat semantic machine.
 * </p>
 * @author Arne Halvorsen (AH)
 * @author Laetitia Le Chatton (LLC)
 */
public class SoekratError 
{
  private String m_soekratSystem;
  
  private String m_soekratImplementation;
  
  private String m_message;
  
  /**
   * <p>
   *   Constructor.
   * </p>
   * @param soekratSystem         System which is the source of error.
   * @param soekratImplementation Implementation of {@code soekratSystem}.
   * @param message               Error message.
   */
  public SoekratError(String soekratSystem, String soekratImplementation, 
    String message)
  {
    if (soekratSystem==null)
    {
      throw new NullPointerException("soekratSystem");
    }
    if (soekratImplementation==null)
    {
      throw new NullPointerException("soekratImplementation");
    }
    if (message==null)
    {
      throw new NullPointerException("message");
    }
    
    m_soekratSystem=soekratSystem;
    m_soekratImplementation=soekratImplementation;
    m_message=message;
  }
  
  @Override
  public String toString()
  {
    StringBuilder sb=new StringBuilder();
    sb.append(m_soekratSystem).append(" : ").append(m_soekratImplementation)
      .append(" : ").append(m_message);
    return sb.toString();
  }
  
}
